Skip to content

fix(core): let fetch compute content length - #212

Open
edenbuilds wants to merge 1 commit into
browserbase:mainfrom
edenbuilds:codex/hunt-sdk-node-197
Open

fix(core): let fetch compute content length#212
edenbuilds wants to merge 1 commit into
browserbase:mainfrom
edenbuilds:codex/hunt-sdk-node-197

Conversation

@edenbuilds

Copy link
Copy Markdown

Summary

  • Stop adding an explicit content-length header to SDK requests.
  • Let fetch/undici compute the value once from the actual body.
  • Replace the old header assertions with a regression test.

Verification

  • Regression test failed on the parent commit because content-length was present.
  • tests/index.test.ts: 31/31 passed after the fix.

Fixes #197

Do not send an explicit content-length header from the SDK. Fetch and undici
already compute it from the request body, and an explicit value can collide
with the computed header when consumers install a custom global dispatcher.

Fixes browserbase#197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

content-length header collision → InvalidArgumentError: invalid content-length header when a custom undici global dispatcher is installed

1 participant